package class_work.chapter_1_4;

import java.util.Scanner;

/**
 * @author haomin
 * @date 2022/03/30 14:13
 **/
public class RandomTopic {
    public static void main(String[] args) {
        int a = (int)(Math.random()*100);
        int b = (int)(Math.random()*100);
        int result = a + b;

        System.out.println("请计算 "+ a + " + " + b + "的结果：" );
        Scanner scanner = new Scanner(System.in);
        int c = scanner.nextInt();

        if(result == c){
            System.out.println("回答正确！");
        }else {
            System.out.println("回答错误！正确答案是：" + result);
        }
    }
}